<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head th:include="include/head">

</head>
<style>
	.form-group{
		margin-left: 5px;
		margin-right: 5px;
		margin-top: 5px;
	}

</style>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
	<div class="content-wrapper">
		<!-- Content Header (Page header) -->
		<section class="content-header">
			<div class="container-fluid">
				<div class="row mb-2">
					<div class="col-sm-6">
						<h1>面试管理</h1>
					</div>
					<div class="col-sm-6">
						<ol class="breadcrumb float-sm-right">
							<li class="breadcrumb-item"><a href="#">首页</a></li>
							<li class="breadcrumb-item active">面试管理</li>
						</ol>
					</div>
				</div>
			</div>
			<!-- /.container-fluid -->
		</section>

		<!-- Main content -->
		<section class="content">
			<div class="container-fluid">
				<div class="row">
					<div class="col-md-12">
						<div class="card">
							<div class="card-header">
								<h3 class="card-title">面试反馈列表</h3>
<!--								<button type="button" class="btn btn-primary" id="add"-->
<!--										style="float: right;">新增流程</button>-->
							</div>
							<div class="card-header">
								<form form id="search-form2" class="navbar-form form-inline"
									  th:action="@{/candidate/baselist}" method="post">
									<div class="form-group">
										<label>归属部门:</label>
										<select name="baseId" id="baseId"  class="form-control">
											<option value="" >全部基地</option>
											<option th:each="base : ${baseList}" th:value="${base.baseId}"  th:selected="${base.baseId}==${baseId}"  th:text="${base.baseName}">
										</select>
									</div>
									<div class="form-group">
										<label>所属项目:</label>
										<select name="projectId"  id="projectId"  class="form-control">
											<option value="" >全部门</option>
											<option  th:each="model : ${projectList}" th:value="${model.projectId}"
													 th:text="${model.projectName}" th:selected="${model.projectId}==${projectId}" value="0"></option>
										</select>
									</div>
									<div class="form-group">
										<label>面试官:</label>
										<input type="text" name="examinerName" th:value="${examinerName}" placeholder="面试官" class="form-control">
									</div>
									<div class="form-group">
										<label>候选人:</label>
										<input type="text" name="candidateName" th:value="${candidateName}" placeholder="候选人" class="form-control">
									</div>
									<div class="form-group">
										<label>面试结果:</label>
										<select name="state"  class="form-control">
											<option value="" >全部</option>
											<option value="0"  th:selected="0==${state}">未开始</option>
											<option value="2"  th:selected="2==${state}">待确认</option>
											<option value="-1"  th:selected="-1==${state}">未通过</option>
											<option value="1"  th:selected="1==${state}">通过</option>
										</select>
									</div>
									<div class="form-group">
										<label>面试时间:</label>
										<input type="text" name="interviewTime"  id="interviewTime" th:value="${interviewTime}" readonly placeholder="面试时间" class="form-control">
									</div>
									<div class="form-group">
										<label>可到岗时间:</label>
										<input type="text" name="checkInTime" id="checkInTime" th:value="${checkInTime}" readonly placeholder="可到岗时间" class="form-control">

									</div>
									<button type="submit" class="btn btn-primary">查询</button>
								</form>
							</div>
							<!-- /.card-header -->
							<div class="card-body">
								<table class="table table-bordered">
									<thead>
									<tr>
										<th style="width: 10px">#</th>
										<th>候选人</th>
										<th>性别</th>
										<th>手机号</th>
										<th>出生日期</th>
										<th>籍贯</th>
										<th>最高学历</th>
										<th>招聘渠道</th>
										<th>基地</th>
										<th>岗位</th>
										<th>面试时间</th>
										<th>面试项目</th>
										<th>面试官</th>
										<th>面试时长</th>
										<th>面试得分</th>
										<th>面试结果</th>
										<th>可到岗时间</th>
										<th style="width: 160px">操作</th>
									</tr>
									</thead>
									<tbody>
									<tr th:each="bean : ${pageInfo.list}"
										th:attr="id=tr_+${bean.cid}">
										<td th:text="${bean.cid}"></td>
										<td th:text="${bean.cname}"></td>
										<td th:text="${bean.cgender}"></td>
										<td th:text="${bean.cmobile}"></td>
										<td th:text="${bean.cbrith}"></td>
										<td th:text="${bean.nplace}"></td>
										<td th:text="${bean.detype}"></td>
										<td th:text="${bean.chname}"></td>
										<td th:text="${bean.bname}"></td>
										<td th:text="${bean.woname}"></td>
										<td th:text="${bean.itime}"></td>
										<td th:text="${bean.pname}"></td>
										<td th:text="${bean.ename}"></td>
										<td th:text="${bean.length}"></td>
										<td th:text="${bean.score}"></td>
										<td th:text="${bean.state}"></td>
										<td th:text="${bean.ctime}"></td>



										<td>
											<a class="btn btn-info btn-sm edit"
											   th:href="'detail?cid='+${bean.cid}"  >
<!--												<i class="fas fa-pencil-alt"></i>-->
												查看</a> &nbsp;&nbsp;

<!--											<a class="btn btn-danger btn-sm del" href="javascript:;"-->
<!--											   th:attr="data-id=|${bean.candidateId}"><i class="fas fa-trash">-->
<!--											</i>禁用</a>-->
										</td>
									</tr>
									</tbody>
								</table>
							</div>
							<!-- /.card-body -->
							<cms:page></cms:page>
							<!-- /.card -->
						</div>

					</div>
				</div>
			</div>
		</section>
	</div>
</div>
<!-- ./wrapper -->
<div th:include="include/foot"></div>
<script>
	$("#interviewTime").datepicker({
		format: 'yyyy-mm-dd ',
		todayBtn: "linked",
		keyboardNavigation: false,
		forceParse: false,
		calendarWeeks: true,
		autoclose: true,
		clearBtn: true,//清除按钮
		minView: 1, //视图展示
	});
	$("#checkInTime").datepicker({
		format: 'yyyy-mm-dd ',
		todayBtn: "linked",
		keyboardNavigation: false,
		forceParse: false,
		calendarWeeks: true,
		autoclose: true,
		clearBtn: true,//清除按钮
		minView: 1, //视图展示
	});
	$().ready(function() {
		$("#add").click(function() {
			loadPage();
			location.href = 'add';
		});
		$(".edit").click(function() {
			loadPage();

		});
		$("#baseId").change(function (){
			let v=$(this).val();
			let t= $(this).find("option:selected").text();
			console.log(v,t)
			if(v>0){
				$("#baseName").val(t);
				$.ajax({url:'../library/projectList',data:"baseId="+v,success:function (data){
						console.log(data)
						if(data.res){
							$("#projectId").empty();
							$("#projectId").append("<option value='0'>全部门</option>");
							for(let i=0;i<data.list.length;i++){
								console.log(data.list[i])
								$("#projectId").append("<option value='"+data.list[i].projectId+"'>"+data.list[i].projectName+"</option>");
							}

						}
					}})
			}else {
				$("#projectId").empty();
				$("#projectId").append("<option value='0'>全部门</option>");
			}

		});
		$(".del").click(function() {
			if (confirm('确定删除内容吗？')) {
				let id = $(this).data('id');
				$.ajax({
					url : 'userDelete?id=' + id,
					success : function(e) {
						if (e.res) {
							$("#tr_" + id).remove();
						}
					},error:function(e){
						layer.msg(e.responseText, {icon: 5});
					}
				});
			}

		});
	});
	loadPage=function(){
		window.parent.loadPage();
	}
</script>
</body>
</html>
